Learn R Programming

OutbreakTools (version 0.1-0)

Plot obkData: Plot outbreak data

Description

The plot method of obkData objects includes various options:
  • timeline: plots requested information as time series; usesplotIndividualTimeline.
  • geo: plots requested information as geographic distribution, on a map; usesplotGeo.
  • mst: minimum-spanning tree based on genetic distances; usesplotggMST.
  • phylo: plot phylogenetic trees stored in the object; usesplotggphy.
  • contacts: plot contacts between individuals stored in the object; usesplot.obkContacts.

Usage

## S3 method for class 'obkData':
plot(x, y=c("timeline","geo","mst","phylo","contacts"), ...)

Arguments

x
a obkData object
y
a character indicating the type of plot to be generated; can be "timeline" (default), "geo", "mst", "phylo", or "contacts".
...
further arguments to be passed to the plotting function, depending on the type of plot selected (see description above).

encoding

UTF-8

See Also

plotIndividualTimeline, plotGeo, plotggMST, plotggphy, plot.obkContacts.

Examples

Run this code
data(HorseFlu)
head(HorseFlu)

## default plot: time line
plot(HorseFlu,orderBy='yardID',colorBy='yardID')
plot(HorseFlu,orderBy='yardID',colorBy='yardID',
     selection=1:30) # only the first 30

## plot contacts
data(ToyOutbreak)
plot(ToyOutbreak, "contacts")

## plot geographic distribution of individuals
plot(HorseFlu, "geo", location=c('lon','lat'), colorBy='sex',
     zoom=12,center='9')

## plot minimum spanning tree for first 10 individuals
get.nindividuals(HorseFlu)
plot(subset(HorseFlu, individuals=1:10), "mst")

Run the code above in your browser using DataLab